<!DOCTYPE html PUBLIC "-//W3C//Dtd XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/Dtd/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ page import="com.infodms.dms.common.Constant"%>
<%@ page import="java.util.*"%>
<%@taglib uri="/jstl/cout" prefix="c" %>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<jsp:include page="${contextPath}/common/jsp_head_new.jsp" />
<style media="print" type="text/css">
	.cssbutton   {   DISPLAY:   none   }          
</style>
<title>活动执行方案打印</title>
<% String contextPath = request.getContextPath();  %>
<script type="text/javascript">
<!--
function getTotalPrice(sName, sId) {
	var totalPrice = 0 ;
	var aPrice = document.getElementsByName(sName) ;
	var iLen = aPrice.length ;

	for(var i=0; i<iLen; i++) {
		totalPrice += parseFloat(aPrice[i].value) ;
	}
	
	document.getElementById(sId).innerHTML = serPrice(totalPrice) ;
}

function getTotalCost() {
	var fTotlaCost = 0 ;
	var iLen = arguments.length ;
	
	for(var i=0; i<iLen; i++) {
		if(document.getElementById(arguments[i]).innerHTML != 'undfined') {
			fTotlaCost += parseFloat(document.getElementById(arguments[i]).innerHTML) ;
		}
	}
	
	document.getElementById("totalCost").innerHTML = serPrice(fTotlaCost) ;
}

function setCost() {
	document.getElementById("cost").innerHTML = serPrice(${cost }) ;
}

function serPrice(fPrice) {
	var aPrice = fPrice.toString().split("\.") ;
	var iLen = aPrice.length ;

	if(iLen == 1) {
		fPrice = aPrice[0] + ".00" ;
	} else if (iLen == 2) {
		var iLen_A = aPrice.length ;

		if(iLen_A == 1) {
			fPrice = aPrice[1] + "0"
		}
	}
	
	return fPrice ;
}
//-->
</script>
</head>
<body onload="setCost() ;getTotalPrice('planCost1','activitPrice') ;getTotalPrice('planCost2','mediaPrice') ;getTotalCost('activitPrice','mediaPrice') ;">
<br />
<div align="center">
<table border="0" cellspacing="0" cellpadding="0" width="800">
<tr>
<td>
	<img src="<%=request.getContextPath()%>/img/chana/logov.jpg" align="left"/>
	<strong><font size="6">长安汽车市场推广计划申请表</font></strong>
</td>
</tr>
</table>
<br />
<table border="1" cellspacing="0" cellpadding="0" width="800">
<tr align="left">
	<td height="45" align="center"><strong>申请<br />单位</strong></td>
	<td><strong>A/B网：</strong></td>
	<td>${map2.AREA_NAME}</td>
	<td colspan="2"><strong>运营大区：</strong></td>
	<td colspan="3">${map2.ORG_NAME}</td>
	<td><strong>服务中心/<br />授权专营店：</strong></td>
	<td colspan="3 ">${map2.DEALER_NAME}　</td>
	<td><strong>申请日期：</strong></td>
	<td>${map2.SUBMITS_DATE}</td>
</tr>
<tr align="left">
	<td height="45" align="center"><strong>费用<br />类别</strong></td>
	<td colspan="13"><script>document.write(getItemValue(${type }));</script></td>
</tr>
<tr align="left">
	<td colspan="10" height="30"><strong>1、月度目标</strong></td>
	<td colspan="4"><strong>2、资源计划</strong></td>
</tr>
<tr align="center">
	<td colspan="2" height="30"><strong>实销数</strong></td>
	<td>${map3.DELIVERY_CNT_TGT }</td>
	<td><strong>辆</strong></td>
	<td colspan="4"><strong>来电（店）数</strong></td>
	<td>${map3.CALLS_HOUSES_CNT_TGT }</td>
	<td><strong>组</strong></td>
	<td colspan="2"><strong>可用费用</strong></td>
	<td align="left"><span id="cost"></span></td>
	<td><strong>元</strong></td>
</tr>
<tr align="center">
	<td colspan="2" height="30"><strong>启票数</strong></td>
	<td>${map3.ORDER_CNT_TGT }</td>
	<td><strong>辆</strong></td>
	<td colspan="4"><strong>信息留存数</strong></td>
	<td>${map3.RESERVE_CNT_TGT }</td>
	<td><strong>组</strong></td>
	<td colspan="2"><strong>预计投入</strong></td>
	<td align="left"><span id="totalCost"></span></td>
	<td><strong>元</strong></td>
</tr>
<tr align="left">
	<td colspan="14" height="30"><strong>3、计划信息</strong></td>
</tr>
<tr>
<td height="30" colspan="3"><strong>计划名称</strong></td>
<td colspan="4"><strong>活动主题</strong></td>
<td colspan="4"><strong>起止日期</strong></td>
<td colspan="3"><strong>申请人</strong></td>
</tr>
<tr>
<td height="30" colspan="3">${map2.CAMPAIGN_NAME}　</td>
<td colspan="4">${map2.CAMPAIGN_SUBJECT}　</td>
<td colspan="4">${map2.START_DATE}~${map2.END_DATE}　</td>
<td colspan="3">${map2.NAME}　</td>
<tr align="left">
	<td colspan="14" height="30"><strong>4、推广活动</strong></td>
</tr>
<tr align="center">
<td height="30"><strong>活动<br />类型</strong></td>
<td colspan="3"><strong>活动内容</strong></td>
<td colspan="3"><strong>活动明细</strong></td>
<td colspan="4"><strong>备注（规格等）</strong></td>
<td><strong>项目<br />数量</strong></td>
<td><strong>项目单价<br />（元）</strong></td>
<td><strong>金额<br />（元）</strong></td>
</tr>
<c:if test="${list1 != null}">
<c:forEach items="${list1}" var="list1">
<tr align="center">
<td height="30">
<script type="text/javascript">
	writeItemValue('${list1.ACTIVITY_TYPE}');
</script>
</td>
<td colspan="3">${list1.ACTIVITY_CONTENT}　</td>
<td colspan="3">${list1.ITEM_NAME}　</td>
<td colspan="4">${list1.ITEM_REMARK}　</td>
<td>${list1.ITEM_COUNT}</td>
<td>${list1.ITEM_PRICE}</td>
<td>
${list1.PLAN_COST}<input name="planCost1" type="hidden" value="${list1.PLAN_COST}"/>
</td>
</tr>
</c:forEach>
<tr align="center">
<td height="30" colspan="7"><strong>费用合计（元）</strong></td>
<td colspan="7" align="left"><span id="activitPrice">0</span></td>
</tr>
</c:if>
<tr align="left">
	<td colspan="14" height="30"><strong>5、媒体投放</strong></td>
</tr>
<tr align="center">
<td height="30"><strong>省份</strong></td>
<td><strong>车型<br />品牌</strong></td>
<td><strong>宣传<br />主题</strong></td>
<td colspan="3"><strong>广告<br />日期</strong></td>
<td colspan="2"><strong>媒体<br />名称</strong></td>
<td><strong>规格/版式<br />单日频次</strong></td>
<td colspan="2"><strong>刊发位置<br/>播出时间</strong></td>
<td><strong>总<br/>次数</strong></td>
<td><strong>结算单价<br /><font size="1">元/次</font></strong></td>
<td><strong>金额<br />（元）</strong></td>
</tr>
<c:if test="${list2 != null}">
<c:forEach items="${list2}" var="list2">
<tr>
<td height="30">
<script type="text/javascript">
	writeRegionName('<c:out value="${list2.REGION}"/>') ;
</script>
</td>
<td>
<label>
<script type="text/javascript">
	writeItemValue("${list2.MEDIA_MODEL}") ;
</script>
</label>
</td>
<td>
	${list2.ADV_SUBJECT}
</td>
<td colspan="3">
	${list2.ADV_DATE}~${list2.END_DATE}
</td>
<td colspan="2">
	${list2.MEDIA_NAME}
</td>
<td>
	${list2.MEDIA_SIZE}
</td>
<td colspan="2">
	${list2.MEDIA_PUBLISH}
</td>
<td>
	${list2.TOTAL_COUNT}
</td>
<td>
	${list2.ITEM_PRICE}
</td>
<td>
	${list2.PLAN_COST}<input type="hidden" name="planCost2" value="${list2.PLAN_COST}" />
</td>
</tr>
</c:forEach>
<tr align="center">
<td height="30" colspan="7"><strong>费用合计（元）</strong></td>
<td colspan="7" align="left"><span id="mediaPrice">0</span></td>
</tr>
</c:if>
<tr align="left">
	<td colspan="14" height="30"><strong>6、审批</strong></td>
</tr>
<tr align="center">
<td height="30" colspan="2"><strong>审批部门</strong></td>
<td colspan="3"><strong>审批人员</strong></td>
<td colspan="3"><strong>审批状态</strong></td>
<td colspan="3"><strong>审批意见</strong></td>
<td colspan="3"><strong>审批时间</strong></td>
</tr>
<c:forEach items="${list3}" var="list3">
<tr align="center">
<td colspan="2" height="30">${list3.ORG_NAME}　</td>
<td colspan="3">${list3.NAME}　</td>
<td colspan="3">
<script type="text/javascript">
	writeItemValue('${list3.CHECK_STATUS}');
</script>　
</td>
	<td colspan="3">${list3.CHECK_DESC}　</td>
	<td colspan="3">${list3.CHECK_DATE}　</td>
</tr>
</c:forEach>
<tr>
<td height="60" align="right" colspan="2"><strong>分管副总意见：</strong></td>
<td colspan="12">　</td>
</tr>
<tr>
<td height="60" align="right" colspan="2"><strong>事业部总经理意见：</strong></td>
<td colspan="12">　</td>
</tr>
</table>
</div>
<br />
<div align="center">
<input type="button" class="cssbutton" onclick="window.print() ;" value="打印">
</div>
</body>
</html>